package com.config.bus.client;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:RenPu
 * @Date: 2020/9/22 11:53
 * @Version: 1.0
 * @description: 动态刷新配置文件
 */

@RestController
@RequestMapping("/refresh")
@RefreshScope
public class RefreshController {


    //1：本地配置文件，同步第三方平台属性值
    //2：读取本地配置文件的值
    @Value("${myWords}")
    private String words;

    @GetMapping("/words")
    public String getWords() {
        return words;
    }


}
